package cn.mw.cmdb.entity;

import cn.mw.cmdb.service.ServiceChoose;
import cn.mw.cmdb.service.impl.ItemNameMapperServiceImpl;
import cn.mw.components.mongodb.anno.AutoId;
import cn.mw.components.mongodb.anno.CMDBProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.List;

@Data
@Document("mw_item_name_mapper")
public class ItemNameMapperInfo implements ServiceChoose {
    @CMDBProperty
    @AutoId
    @Schema(description = "id")
    protected String id;

    @Schema(description = "zabbix监控项")
    @CMDBProperty(searchType = PropertyTypeString.ID, keywordSearch = true)
    protected String zabbixItem;

    @Schema(description = "prometheus监控项名称")
    @CMDBProperty(searchType = PropertyTypeString.ID, keywordSearch = true)
    protected String prometheusItem;

    @Schema(description = "中文描述")
    @CMDBProperty(searchType = PropertyTypeString.ID, keywordSearch = true)
    protected String descrCn;

    @Override
    @Schema(description = "模型服务Id")
    public String getServiceId() {
        return ItemNameMapperServiceImpl.ID;
    }

    @Transient
    private String instanceId;

    @Transient
    private List<String> itemList;

    //类型:类型(Zabbix or Prometheus)
    @Transient
    private String type;

    //查询时使用
    @Transient
    private String item;

}
